//
//  JSVirtualMachine.h
//  iCodeMac
//
//  Created by Andrew Barry on 4/03/09.
//  Copyright 2009 Barry Computer Services. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class AppStack;
@class AppModule;

@interface JSVirtualMachine : NSObject {
	@public bool stop;
	bool inVM, suspendedVM;
	AppStack *stack;
	void *vmContext;
	void *mainContext;
	void *contextStack;
}
-(id)initWithStack:(AppStack *) s;
-(bool)isRunningVM;
-(bool)isSuspended;
-(void)runModule: (AppModule *) module;
-(void)callFunction: (JSContext *) cx withTarget: (JSObject *) target withFunction: (jsval)  prop;
-(void)finished;
-(void)suspend;
-(void)resume;
-(void)stop;
@end
